package com.cdgeekcamp.redas.wechat.factory;

import com.cdgeekcamp.redas.wechat.entity.WeChatMenu;

import java.util.ArrayList;

public class WeChatMenuFactory {
    ArrayList<WeChatMenu> weChatMenus;

    public WeChatMenuFactory() {
        weChatMenus = new ArrayList<>();
        // 一级菜单
        WeChatMenu onceMenu1 = new WeChatMenu("订阅", "click", "sub");
        WeChatMenu onceMenu2 = new WeChatMenu("职位", new ArrayList<>());
        WeChatMenu onceMenu3 = new WeChatMenu("统计", new ArrayList<>());

        // 二级菜单
        WeChatMenu secondMenu1_to_onceMenu2 = new WeChatMenu("职位解析", "click", "position_analyze");
        WeChatMenu secondMenu2_to_onceMenu2 = new WeChatMenu("职位列表", "click", "position_list");

        onceMenu2.addValue(secondMenu1_to_onceMenu2);
        onceMenu2.addValue(secondMenu2_to_onceMenu2);

        WeChatMenu secondMenu3_to_onceMenu3 = new WeChatMenu("本周统计", "click", "week_chart");
        WeChatMenu secondMenu4_to_onceMenu3 = new WeChatMenu("本月统计", "click", "month_chart");

        onceMenu3.addValue(secondMenu3_to_onceMenu3);
        onceMenu3.addValue(secondMenu4_to_onceMenu3);

        // 菜单
        weChatMenus.add(onceMenu1);
        weChatMenus.add(onceMenu2);
        weChatMenus.add(onceMenu3);
    }

    public ArrayList<WeChatMenu> getMenu(){
        return this.weChatMenus;
    }
}
